import xlwt
import xlrd
book1=xlwt.Workbook(encoding='utf-8')
sheet=book1.add_sheet('sheet2',cell_overwrite_ok=True)
dir={'f1':['学号','姓名','性别','年龄','班级'],
     'f2':['2018001','张珊','女','18.0','计算机1801'],
     'f3':['2018002','李斯','男','19.0','计算机1802'],
     'f4':['2018003','王武','男','18.0','计算机1801'],
     'f5':['2018004','赵柳','女','19.0','计算机1802'],
     'f2':['2018005','吴鹏飞','男','18.0','计算机1801',]}
row=0
col=0
for i in dir.keys():
    for j in dir[i]:
        sheet.write(row,col,j)
        col+=1
    col=0
    row+=1
book1.save(r'3.3.xls')
wb=xlrd.open_workbook('3.3.xls')
print('学生信息如下:')
sheet=wb.sheet_by_index(0)
for i in sheet:
    for j in i:
        print(j,end=' ')
    print('\n')

